package jwt

import (
	"time"

	"github.com/dgrijalva/jwt-go"

	"project/study-go/config"
)

//UserClaim 自定义用户的jwt payload
type UserClaims struct {
	Data map[string]interface{}
	jwt.StandardClaims
}

//GetDefaultClaims 默认jwt标准声明
func GetDefaultClaims() jwt.StandardClaims {
	DefaultClaims := jwt.StandardClaims{
		Audience:  "gopher",
		ExpiresAt: time.Now().Add(config.Vip.GetDuration("jwt.ExpiresAt")).Unix(),
		IssuedAt:  time.Now().Unix(),
		Issuer:    "study-go",
	}
	return DefaultClaims
}
